<script setup lang="ts">
import {printpdf, savepdf} from '@/utils/printpdf.js'
const handlePrint = () => {
    window.print()
}
const handleSave = () => {
    savepdf("printPage", false)
}
</script>
<template>
  <div>
    <div class="no-print">
        <button @click="handlePrint">Print</button>
        <button @click="handleSave">Save</button>
    </div>
    <div id="printPage">
      <table>
        <th>
          <tr>
            <td>姓名</td>
            <td>学号</td>
          </tr>
        </th>
        <tbody>
          <tr>
            <td>吴三桂</td>
            <td>12</td>
          </tr>
          <tr>
            <td>易小川</td>
            <td>13</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>

<style scoped>
@media print {
            .no-print {
                display: none;
            }
        }
</style>
